package com.example.demo.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.PricingStandard;
import com.example.demo.entity.SysUser;
import com.example.demo.mapper.PricingStandardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PricingStandardService extends ServiceImpl<PricingStandardMapper, PricingStandard> {

    PricingStandardMapper pricingStandardMapper;
    @Autowired
    public PricingStandardService(PricingStandardMapper pricingStandardMapper){
        this.pricingStandardMapper=pricingStandardMapper;
    }

    public List<PricingStandard> getAll() {
        List<PricingStandard> list=pricingStandardMapper.selectList(null);
        return list;
//        return mapper.selectList(null);
    }

    public PricingStandard getById(Long id) {
        PricingStandard entity=pricingStandardMapper.selectById(id);
        return entity;

    }


    public boolean insert(PricingStandard entity) {
        int result=pricingStandardMapper.insert(entity);

        return result>0?true:false;
    }


    public boolean update(PricingStandard entity) {
        int result=pricingStandardMapper.updateById(entity);
        return result>0?true:false;
    }


    public boolean delete(Long id) {
        int result=pricingStandardMapper.deleteById(id);
        return result>0?true:false;
    }



}
